home *** CD-ROM | disk | FTP | other *** search
/ NeXTSTEP 3.3 (Developer)…68k, x86, SPARC, PA-RISC] / NeXTSTEP 3.3 Dev Intel.iso / NextDeveloper / Headers / objc / Storage.h < prev    next >
Text File  |  1991-11-26  |  2KB  |  70 lines

  1. /*
  2.     Storage.h
  3.     Copyright 1988, 1989 NeXT, Inc.
  4.  
  5.     DEFINED AS:    A common class
  6.     HEADER FILES:    objc/Storage.h
  7. */
  8.  
  9. #ifndef _OBJC_STORAGE_H_
  10. #define _OBJC_STORAGE_H_
  11.  
  12. #import <objc/Object.h>
  13. #import <objc/typedstream.h>
  14.  
  15. @interface Storage : Object
  16. {
  17. @public
  18.     void    *dataPtr;    /* Data of the Storage object */
  19.     const char    *description;    /* Encoded data type of the stored elements */
  20.     unsigned    numElements;    /* Number of elements actually in the array */
  21.     unsigned    maxElements;    /* Total allocated elements */
  22.     unsigned    elementSize;    /* Size of each element in the array */
  23. }
  24.  
  25. /* Creating, freeing, initializing, and emptying */
  26.  
  27. - init;
  28. - initCount:(unsigned)count elementSize:(unsigned)sizeInBytes 
  29.     description:(const char *)descriptor;
  30. - free; 
  31. - empty;
  32. - copyFromZone:(NXZone *)zone;
  33.   
  34. /* Manipulating the elements */
  35.  
  36. - (BOOL)isEqual: anObject;
  37. - (const char *)description; 
  38. - (unsigned)count; 
  39. - (void *)elementAt:(unsigned)index; 
  40. - replaceElementAt:(unsigned)index with:(void *)anElement;
  41. - setNumSlots:(unsigned)numSlots; 
  42. - setAvailableCapacity:(unsigned)numSlots;
  43. - addElement:(void *)anElement; 
  44. - removeLastElement; 
  45. - insertElement:(void *)anElement at:(unsigned)index; 
  46. - removeElementAt:(unsigned)index; 
  47.  
  48. /* Archiving */
  49.  
  50. - write:(NXTypedStream *)stream;
  51. - read:(NXTypedStream *)stream;
  52.  
  53. /*
  54.  * The following new... methods are now obsolete.  They remain in this 
  55.  * interface file for backward compatibility only.  Use Object's alloc method 
  56.  * and the init... methods defined in this class instead.
  57.  */
  58.  
  59. + new; 
  60. + newCount:(unsigned)count elementSize:(unsigned)sizeInBytes 
  61.     description:(const char *)descriptor; 
  62.  
  63. @end
  64.  
  65. typedef struct {
  66.     @defs(Storage)
  67. } NXStorageId;
  68.  
  69. #endif /* _OBJC_STORAGE_H_ */
  70.